class Solution {
public:
    ListNode* FindKthToTail(ListNode* pHead, int k)
    {
        ListNode* cur = pHead;
        int i = 0;
        while (cur != nullptr)
        {
            cur = cur->next;
            i++;
        }
        if (k > i)
            return nullptr;
        for (int j = 0; j < i - k; j++)
        {
            pHead = pHead->next;
        }
        return pHead;
    }
};